package cn.lanqiao.bigDate.api.controller;

import cn.lanqiao.common.utils.TokenUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/* 类注解 */
//@Api(value = "desc of class")
@RestController
public class HelloController {

    /* 方法注解 */
    @ApiOperation(value = "desc of method", notes = "")
    @GetMapping(value="/hello")
    public Object hello( /* 参数注解 */
            @ApiParam(value = "学生id" , required=true )
            @RequestParam String name,String token) {
        if(!TokenUtil.verify(token)){
            return "你没有权限访问";
        }else {
            return "Hello " + name + "!";

        }

    }
}